Harmonic grammar